<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>立方体</title>
		<link rel="stylesheet" type="text/css" href="../../css/reset-min.css"/>
		<style type="text/css">
			.wrap{
				
				position: absolute;
				left: 0;
				right: 0;
				top: 0;
				bottom: 0;
				margin: auto;
				
				width: 300px;
				height: 300px;
				border: 1px solid;
				
				/* 搭建3d */
				perspective: 200px;
				transform-style: preserve-3d;
			}
			.wrap > .inner{
				position: absolute;
				left: 0;
				right: 0;
				top: 0;
				bottom: 0;
				margin: auto;
				
				width: 100px;
				height: 100px;
				
				transition: 3s;
				transform-style: preserve-3d;
				transform-origin: center center -50px;
			}
			.wrap > .inner > div{
				position: absolute;
				
				width: 100px;
				height: 100px;
				background-color: #BBFFAA;
				
				text-align: center;
				font: 50px/100px "微软雅黑";
			}
			.wrap > .inner > div:nth-child(5){
				top:-100px;
				transform-origin: bottom;
				transform: rotateX(90deg);
			}
			.wrap > .inner > div:nth-child(6){
				bottom:-100px;
				transform-origin: top;
				transform: rotateX(-90deg);
			}
			.wrap > .inner > div:nth-child(3){
				left:-100px;
				transform-origin:right;
				transform: rotateY(-90deg);
			}
			.wrap > .inner > div:nth-child(4){
				right:-100px;
				transform-origin:left;
				transform: rotateY(90deg);
			}
			.wrap > .inner > div:nth-child(2){
				transform: translateZ(-100px) rotateX(180deg);
			}
			.wrap > .inner > div:nth-child(1){
				z-index: 1;
			}
			
			.wrap:hover .inner{
				transform: rotateX(360deg);
			}
		</style>
	</head>
	<body>
		<div class="wrap">
			<div class="inner">
				<div>前</div>
				<div>后</div>
				<div>左</div>
				<div>右</div>
				<div>上</div>
				<div>下</div>
			</div>
		</div>
	</body>
</html>
